avoid std::min with QString::size
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Tue, 12 Oct 2021 21:20:35 +0000 (15:20 -0600)
committertsteven4 <13596209+tsteven4@users.noreply.github.com>
Tue, 12 Oct 2021 21:20:35 +0000 (15:20 -0600)
missed one in previous commit.

igo8.cc

diff --git a/igo8.cc b/igo8.cc
index 8b361a7944555f1ede4873b32d59a1e767ad9fc1..88cbc40cb660800cad43dc41f94f89ddffad633f 100644 (file)
--- a/igo8.cc
+++ b/igo8.cc
@@ -61,7 +61,6 @@
 
 */
 
-#include <algorithm>
 #include <cstdio>               // for SEEK_SET
 #include <cstdint>
 #include <cstdlib>              // for atoi
@@ -70,7 +69,6 @@
 #include <QChar>                // for QChar
 #include <QString>              // for QString
 #include <QVector>              // for QVector
-#include <QtGlobal>             // for ushort
 
 #include "defs.h"
 #include "gbfile.h"             // for gbfwrite, gbfclose, gbfseek, gbfgetint32, gbfread, gbfile, gbfopen_le
@@ -261,7 +259,7 @@ static unsigned int print_unicode(char* dst, int dst_max_length, const QString&
   }
   // Write as many characters from the source as possible
   // while leaving space for a terminator.
-  int n_src_qchars = std::min(max_qchars - 1, src.size());
+  int n_src_qchars =  src.size() > (max_qchars - 1) ? max_qchars - 1 : src.size();
   for (int i = 0; i < n_src_qchars; ++i) {
     le_write16(dst, src.at(i).unicode());
     dst += 2;